package com.itheima.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class demo03 {
    public static void main(String[] args) throws ParseException {
        String start="2020-11-11 0:0:0";
        String end="2020-11-11 0:10:0";
        String jia="2020-11-11 0:03:47";
        String pi="2020-11-11 0:10:11";
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        long startTime = sdf.parse(start).getTime();
        long endTime = sdf.parse(end).getTime();
        long jiaTime = sdf.parse(jia).getTime();
        long piTime = sdf.parse(pi).getTime();
        if (jiaTime>=startTime&&jiaTime<=endTime){
            System.out.println("小贾成功参与活动");
        }else{
            System.out.println("小贾没有成功参与活动");
        }
        if (piTime>=startTime&&piTime<=endTime){
            System.out.println("小皮成功参与活动");
        }else{
            System.out.println("小皮没有成功参与活动");
        }
    }
}
